Socket
Socket
Sign inDemoInstall

@meniga/storage

Package Overview
Dependencies
3
Maintainers
3
Versions
85
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meniga/storage


Version published
Maintainers
3
Install size
1.72 MB
Created

Readme

Source

@meniga/storage

Storage is a utility library for saving information in local and session storage and uses the store2 and shared-session-storage dependencies.

Configuration


Default store

The default store used is the sessionStorage, but you can specify to use localStorage by default if you prefer.

Use the auth config to do that by setting useLocalStorage to true.

Multitab support

If you want to include multitab support when using session storage, set useSharedSessionStorage to true in the auth.js config.

Note: Multitab support is only needed when not using cookie-based authentication, such as the Meniga STS authentication service.

Example:

{
	auth: {
		useLocalStorage: false,
		useSharedSessionStorage: true,
	}
}

API


The getItem, setItem, removeItem and clearStorage methods work with the store set as default, while getLocalItem and getSessionItem (et al) work on specific stores.

Full list of API methods:

  • getItem ( key )
  • getLocalItem ( key )
  • getSessionItem ( key )
  • setItem ( key, value )
  • setLocalItem ( key, value )
  • setSessionItem ( key, value )
  • removeItem ( key )
  • removeLocalItem ( key )
  • removeSessionItem ( key )
  • clearStorage ()
  • clearLocalStorage ()
  • clearSessionStorage ()

FAQs

Last updated on 27 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc